Skip to content

Conversation

@rachelmcr
Copy link
Contributor

@rachelmcr rachelmcr commented Dec 14, 2022

Part of: #8363

Description

This PR adds support in the Yosemite layer for fetching site summary stats for the Analytics Hub. It adds a new action to fetch the SiteSummaryStats from remote.

For multiple periods, it fetches the interval data and manually converts it into summary stats. (We'll use this for quarters, which we can fetch as 3 month periods because there isn't a supported quarter period for this endpoint. Internal ref: pe5uwI-5c-p2)

Changes

  • Updates the naming of stats store errors from SiteVisitStatsStoreError to SiteStatsStoreError to better reflect that they can be any errors returned by SiteStatsRemote.
  • Adds the new retrieveSiteSummaryStats to StatsActionV4 and StatsStoreV4 to support retrieving summary stats:
    • When a single period is requested, we make the request to the remote summary stats endpoint.
    • When multiple periods are requested, we make the request to the remote visit stats endpoint. This is because the summary stats endpoint only returns a single period of visitor data. For multiple periods we'll need to summarize the stats from interval data.
  • Adds store unit tests.

Testing

This action isn't used in the app yet, so confirm tests look reasonable and pass.

Submitter Checklist

Update release notes:

  • I have considered if this change warrants user-facing release notes and have added them to RELEASE-NOTES.txt if necessary.

@rachelmcr rachelmcr added the feature: stats Related to stats, including Top Performers. label Dec 14, 2022
@rachelmcr rachelmcr added this to the 11.7 milestone Dec 14, 2022
@peril-woocommerce
Copy link

Warnings
⚠️ This PR is assigned to a milestone which is closing in less than 2 days Please, make sure to get it merged by then or assign it to a later expiring milestone

Generated by 🚫 dangerJS

@wpmobilebot
Copy link
Collaborator

You can test the changes from this Pull Request by:
  • Clicking here or scanning the QR code below to access App Center
  • Then installing the build number pr8410-a61614e on your iPhone

If you need access to App Center, please ask a maintainer to add you.

@Ecarrion Ecarrion self-assigned this Dec 14, 2022
Copy link
Contributor

@Ecarrion Ecarrion left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@rachelmcr rachelmcr merged commit b1644f7 into trunk Dec 14, 2022
@rachelmcr rachelmcr deleted the issue/8363-summary-stats-action-yosemite branch December 14, 2022 14:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature: stats Related to stats, including Top Performers.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants